package com.tang.generate.service

import com.baomidou.mybatisplus.core.metadata.IPage
import com.github.yulichang.base.MPJBaseService
import com.tang.framework.core.domain.HttpResult
import com.tang.common.model.req.ReqId
import com.tang.common.model.req.ReqIds
import com.tang.common.model.req.ReqString
import com.tang.common.model.req.ReqStrings
import com.tang.generate.domain.GenFieldType
import com.tang.generate.domain.GenTable
import com.tang.generate.model.req.ReqGenTable
import com.tang.generate.model.req.ReqGenerate
import com.tang.generate.model.req.TableAddReq
import com.tang.generate.model.res.ResGenDetail
import com.tang.generate.model.res.ResGenTableItem
import org.springframework.web.bind.annotation.RequestBody
import jakarta.servlet.http.HttpServletResponse

interface IGenService : MPJBaseService<GenTable> {

    fun list(@RequestBody reqGenTableItem: ReqGenTable): IPage<ResGenTableItem>
    fun detail(reqId: ReqId): ResGenDetail?
    fun importTable(reqStrings: ReqStrings): HttpResult<String?>
    fun databaseTableList(reqGenTableItem: ReqGenTable): HttpResult<IPage<Unit>>?
    fun editGenTable(resGenDetail: ResGenDetail): HttpResult<String?>
    fun downloadCode(reqIds: ReqIds, httpServletResponse: HttpServletResponse)
    fun previewCode(reqIds: ReqIds): Map<String, String>
    fun genFieldTypeList(reqString: ReqString): List<GenFieldType>?
    fun generateDictCode(reqGenerate: ReqGenerate?, httpServletResponse: HttpServletResponse)
    fun createEnum(reqId: ReqId, httpServletResponse: HttpServletResponse?)
    fun save(tableAddReq: TableAddReq);
    fun syncTable(reqStrings: ReqStrings): HttpResult<String>
    fun generateLocal(reqGenerate: ReqGenerate?)


}
